<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>sipML5: tsip_stack Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="sipml-45x51.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">sipML5
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">World&#39;s first HTML5 SIP Client</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.8.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a>  </div>
  <div class="headertitle">
<div class="title">tsip_stack Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><a href="classtsip__stack-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a3f9e89e957514676e58938cd717a3991"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtsip__stack.html#a3f9e89e957514676e58938cd717a3991">tsip_stack</a> (String s_realm, String s_impi, String s_impu_uri, String s_proxy_cscf_host, int i_proxy_cscf_port)</td></tr>
<tr class="memitem:aa40a9daa718da1c25a757ef8a8c47cad"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtsip__stack.html#aa40a9daa718da1c25a757ef8a8c47cad">SetProxyOutBound</a> (String s_proxy_host, int i_proxy_port, tsip_transport_type_e e_proxy_type)</td></tr>
<tr class="memitem:ac50b889da034f75ee3cfbb75e861acd2"><td class="memItemLeft" align="right" valign="top">Object&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtsip__stack.html#ac50b889da034f75ee3cfbb75e861acd2">SetProxyCSCF</a> (String s_proxy_host, int i_proxy_port, tsip_transport_type_e e_proxy_type)</td></tr>
<tr class="memitem:ada33ff0fb5a3e9e683595e0f8d1aa764"><td class="memItemLeft" align="right" valign="top">Object&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtsip__stack.html#ada33ff0fb5a3e9e683595e0f8d1aa764">SetPassword</a> (String s_password)</td></tr>
<tr class="memitem:ac93c80544bd79edd944a1491d462559b"><td class="memItemLeft" align="right" valign="top">Object&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtsip__stack.html#ac93c80544bd79edd944a1491d462559b">SetHeader</a> (String s_name, String s_value)</td></tr>
<tr class="memitem:a1efcd141b35c3cfae2aeb852bdca90bb"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtsip__stack.html#a1efcd141b35c3cfae2aeb852bdca90bb">start</a> ()</td></tr>
<tr class="memitem:a3dfc02095bef002acd84d8e0f21e3417"><td class="memItemLeft" align="right" valign="top">Object&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtsip__stack.html#a3dfc02095bef002acd84d8e0f21e3417">SetDisplayName</a> (String s_display_name)</td></tr>
<tr class="memitem:ad2afa98257299de6215bca46c6cbad53"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtsip__stack.html#ad2afa98257299de6215bca46c6cbad53">set</a> ()</td></tr>
<tr class="memitem:acb9bcfe4f3764f7f42604275d9385daa"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtsip__stack.html#acb9bcfe4f3764f7f42604275d9385daa">stop</a> (int i_timeout)</td></tr>
<tr><td colspan="2"><h2><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr class="memitem:a9b0aa5e2c48c1aaf3d44dbb7000f2ef8"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtsip__stack.html#a9b0aa5e2c48c1aaf3d44dbb7000f2ef8">on_event_invite</a></td></tr>
<tr class="memitem:a987590d3e87ad0373356f1f966e2fab9"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtsip__stack.html#a987590d3e87ad0373356f1f966e2fab9">on_event_stack</a></td></tr>
<tr class="memitem:aae58d97571234f488efab116a83db829"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtsip__stack.html#aae58d97571234f488efab116a83db829">on_event_dialog</a></td></tr>
<tr class="memitem:a157d58b5ad23f6ebcdda46f0d99088ae"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtsip__stack.html#a157d58b5ad23f6ebcdda46f0d99088ae">on_event_message</a></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Signature: tsip_stack_create(s_realm, s_impi, s_impu_uri, s_proxy_cscf_host, i_proxy_cscf_port, ...<a class="el" href="classtsip__stack.html#ad2afa98257299de6215bca46c6cbad53">set()</a>) </p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a3f9e89e957514676e58938cd717a3991"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classtsip__stack.html#a3f9e89e957514676e58938cd717a3991">tsip_stack::tsip_stack</a> </td>
          <td>(</td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>s_realm</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>s_impi</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>s_impu_uri</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>s_proxy_cscf_host</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>i_proxy_cscf_port</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This is the main function (constructor) used to create a SIP/IMS stack and it <b>takes variable arguments</b>. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">s_realm</td><td>the SIP domain name. e.g. 'doubango.org' </td></tr>
    <tr><td class="paramname">s_impi</td><td>the IMS Private identity. e.g. 'alice' </td></tr>
    <tr><td class="paramname">s_impu_uri</td><td>the IMS public identity wich must be a valid SIP Uri. e.g. 'sip:<a href="#" onclick="location.href='mai'+'lto:'+'ali'+'ce'+'@do'+'ub'+'ang'+'o.'+'org'; return false;">alice<span style="display: none;">.nosp@m.</span>@dou<span style="display: none;">.nosp@m.</span>bango<span style="display: none;">.nosp@m.</span>.org</a>' </td></tr>
    <tr><td class="paramname">s_proxy_cscf_host</td><td>the Proxy domain name or IP address. e.g. '192.168.0.1' or 'example.org'. </td></tr>
    <tr><td class="paramname">i_proxy_cscf_port</td><td>the proxy port.</td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><pre class="fragment"> var o_stack = <span class="keyword">new</span> <a class="code" href="classtsip__stack.html#a3f9e89e957514676e58938cd717a3991">tsip_stack</a>(<span class="stringliteral">&quot;doubango.org&quot;</span>, <span class="stringliteral">&quot;alice&quot;</span>, <span class="stringliteral">&quot;sip:alice@doubango.org&quot;</span>, <span class="stringliteral">&quot;192.168.0.12&quot;</span>, 5062,
    <a class="code" href="classtsip__stack.html">tsip_stack</a>.prototype.<a class="code" href="classtsip__stack.html#ada33ff0fb5a3e9e683595e0f8d1aa764">SetPassword</a> (<span class="stringliteral">&quot;mypassword&quot;</span>),
    <a class="code" href="classtsip__stack.html">tsip_stack</a>.prototype.<a class="code" href="classtsip__stack.html#a3dfc02095bef002acd84d8e0f21e3417">SetDisplayName</a>(<span class="stringliteral">&quot;alice&quot;</span>),
    <a class="code" href="classtsip__stack.html">tsip_stack</a>.prototype.<a class="code" href="classtsip__stack.html#ac93c80544bd79edd944a1491d462559b">SetHeader</a>(<span class="stringliteral">&quot;User-Agent&quot;</span>, <span class="stringliteral">&quot;IM-client/OMA1.0 sipML5/v0.0.0000.0&quot;</span>),
    <a class="code" href="classtsip__stack.html">tsip_stack</a>.prototype.<a class="code" href="classtsip__stack.html#ac93c80544bd79edd944a1491d462559b">SetHeader</a>(<span class="stringliteral">&quot;Organization&quot;</span>, <span class="stringliteral">&quot;Doubango Telecom&quot;</span>)
);
</pre></div> 
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ad2afa98257299de6215bca46c6cbad53"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classtsip__stack.html#ad2afa98257299de6215bca46c6cbad53">tsip_stack::set</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Sets static parameters. The function takes parameters created using static functions <b>tsip_stack.prototype.Set*</b> </p>
<dl class="section see"><dt>See also:</dt><dd><a class="el" href="classtsip__stack.html#a3dfc02095bef002acd84d8e0f21e3417">SetDisplayName</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a3dfc02095bef002acd84d8e0f21e3417"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Object <a class="el" href="classtsip__stack.html#a3dfc02095bef002acd84d8e0f21e3417">tsip_stack::SetDisplayName</a> </td>
          <td>(</td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>s_display_name</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Sets SIP Display Name </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">s_display_name</td><td>New SIP Display Name value </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>Parameter object</dd></dl>
<div class="fragment"><pre class="fragment">o_stack.set(<a class="code" href="classtsip__stack.html">tsip_stack</a>.prototype.<a class="code" href="classtsip__stack.html#a3dfc02095bef002acd84d8e0f21e3417">SetDisplayName</a>(<span class="stringliteral">&#39;alice&#39;</span>));
</pre></div> 
</div>
</div>
<a class="anchor" id="ac93c80544bd79edd944a1491d462559b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Object <a class="el" href="classtsip__stack.html#ac93c80544bd79edd944a1491d462559b">tsip_stack::SetHeader</a> </td>
          <td>(</td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>s_name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>s_value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Adds SIP header to all sessions created using this stack </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">s_name</td><td>SIP header name </td></tr>
    <tr><td class="paramname">s_value</td><td>SIP valaue </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>Parameter object</dd></dl>
<div class="fragment"><pre class="fragment">o_stack.set(
    <a class="code" href="classtsip__stack.html">tsip_stack</a>.prototype.<a class="code" href="classtsip__stack.html#ac93c80544bd79edd944a1491d462559b">SetHeader</a>(<span class="stringliteral">&#39;User-Agent&#39;</span>, <span class="stringliteral">&#39;sipML5 client&#39;</span>),
    <a class="code" href="classtsip__stack.html">tsip_stack</a>.prototype.<a class="code" href="classtsip__stack.html#ac93c80544bd79edd944a1491d462559b">SetHeader</a>(<span class="stringliteral">&#39;Organization&#39;</span>, <span class="stringliteral">&#39;Doubango Telecom&#39;</span>)
);
</pre></div> 
</div>
</div>
<a class="anchor" id="ada33ff0fb5a3e9e683595e0f8d1aa764"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Object <a class="el" href="classtsip__stack.html#ada33ff0fb5a3e9e683595e0f8d1aa764">tsip_stack::SetPassword</a> </td>
          <td>(</td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>s_password</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Sets SIP password for authentication </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">s_password</td><td>SIP password for authentication </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>Parameter object</dd></dl>
<div class="fragment"><pre class="fragment">o_stack.set(<a class="code" href="classtsip__stack.html">tsip_stack</a>.prototype.<a class="code" href="classtsip__stack.html#ada33ff0fb5a3e9e683595e0f8d1aa764">SetPassword</a>(<span class="stringliteral">&#39;mysecret&#39;</span>));
</pre></div> 
</div>
</div>
<a class="anchor" id="ac50b889da034f75ee3cfbb75e861acd2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Object <a class="el" href="classtsip__stack.html#ac50b889da034f75ee3cfbb75e861acd2">tsip_stack::SetProxyCSCF</a> </td>
          <td>(</td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>s_proxy_host</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>i_proxy_port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">tsip_transport_type_e&#160;</td>
          <td class="paramname"><em>e_proxy_type</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Updates SIP Proxy host, port and type. Using version 1.0 of sipML5 only WebSocket type is supported. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">s_proxy_host</td><td>Proxy IP address or hostname </td></tr>
    <tr><td class="paramname">i_proxy_port</td><td>Proxy port </td></tr>
    <tr><td class="paramname">e_proxy_type</td><td>Network type. For now only <b>WS</b> and <b>WSS</b> are supported. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>Parameter object</dd></dl>
<div class="fragment"><pre class="fragment">o_stack.set(<a class="code" href="classtsip__stack.html">tsip_stack</a>.prototype.<a class="code" href="classtsip__stack.html#ac50b889da034f75ee3cfbb75e861acd2">SetProxyCSCF</a>(<span class="stringliteral">&quot;192.168.0.10&quot;</span>, 5060, tsip_transport_type_e.UDP));
</pre></div> 
</div>
</div>
<a class="anchor" id="aa40a9daa718da1c25a757ef8a8c47cad"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classtsip__stack.html#aa40a9daa718da1c25a757ef8a8c47cad">tsip_stack::SetProxyOutBound</a> </td>
          <td>(</td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>s_proxy_host</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>i_proxy_port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">tsip_transport_type_e&#160;</td>
          <td class="paramname"><em>e_proxy_type</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Static parameter function used to set the SIP outbound proxy. This function is only needed if there is no DNS entries for the <b>realm</b> defined in the SIP stack creation. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">s_proxy_host</td><td>Outbound proxy host IP address or domain name. e.g. '192.168.0.10' or 'example.com' </td></tr>
    <tr><td class="paramname">i_proxy_port</td><td>Outbound proxy port. e.g. 5060 </td></tr>
    <tr><td class="paramname">e_proxy_type</td><td>Transport protocol type</td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><pre class="fragment">var o_stack = <span class="keyword">new</span> <a class="code" href="classtsip__stack.html#a3f9e89e957514676e58938cd717a3991">tsip_stack</a>(<span class="stringliteral">&quot;doubango.org&quot;</span>, <span class="stringliteral">&quot;alice&quot;</span>, <span class="stringliteral">&quot;sip:alice@doubango.org&quot;</span>, <span class="stringliteral">&quot;192.168.0.12&quot;</span>, 5062,
<a class="code" href="classtsip__stack.html">tsip_stack</a>.prototype.<a class="code" href="classtsip__stack.html#aa40a9daa718da1c25a757ef8a8c47cad">SetProxyOutBound</a>(<span class="stringliteral">&quot;192.168.0.10&quot;</span>, 5060, tsip_transport_type_e.UDP)
<a class="code" href="classtsip__stack.html">tsip_stack</a>.prototype.<a class="code" href="classtsip__stack.html#ada33ff0fb5a3e9e683595e0f8d1aa764">SetPassword</a> (<span class="stringliteral">&quot;mypassword&quot;</span>),
<a class="code" href="classtsip__stack.html">tsip_stack</a>.prototype.<a class="code" href="classtsip__stack.html#a3dfc02095bef002acd84d8e0f21e3417">SetDisplayName</a>(<span class="stringliteral">&quot;alice&quot;</span>),
<a class="code" href="classtsip__stack.html">tsip_stack</a>.prototype.<a class="code" href="classtsip__stack.html#ac93c80544bd79edd944a1491d462559b">SetHeader</a>(<span class="stringliteral">&quot;User-Agent&quot;</span>, <span class="stringliteral">&quot;IM-client/OMA1.0 sipML5/v0.0.0000.0&quot;</span>),
<a class="code" href="classtsip__stack.html">tsip_stack</a>.prototype.<a class="code" href="classtsip__stack.html#ac93c80544bd79edd944a1491d462559b">SetHeader</a>(<span class="stringliteral">&quot;Organization&quot;</span>, <span class="stringliteral">&quot;Doubango Telecom&quot;</span>)
);
<span class="comment">// or</span>
o_stack.set(<a class="code" href="classtsip__stack.html">tsip_stack</a>.prototype.<a class="code" href="classtsip__stack.html#aa40a9daa718da1c25a757ef8a8c47cad">SetProxyOutBound</a>(<span class="stringliteral">&quot;192.168.0.10&quot;</span>, 5060, tsip_transport_type_e.UDP));
</pre></div> 
</div>
</div>
<a class="anchor" id="a1efcd141b35c3cfae2aeb852bdca90bb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classtsip__stack.html#a1efcd141b35c3cfae2aeb852bdca90bb">tsip_stack::start</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Starts the SIP stack. This function must be the first one to be called. This function is asynchronous which means that the stack will not be immediately started after the call. To get feedbacks about the status (success or error), you must subscribe to <a class="el" href="classtsip__stack.html#a987590d3e87ad0373356f1f966e2fab9">on_event_stack</a>. </p>
<dl class="section return"><dt>Returns:</dt><dd>0 if succeed and non-zero value otherwise </dd></dl>

</div>
</div>
<a class="anchor" id="acb9bcfe4f3764f7f42604275d9385daa"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classtsip__stack.html#acb9bcfe4f3764f7f42604275d9385daa">tsip_stack::stop</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>i_timeout</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Stops the SIP stack. Feedbacks will be reported to <a class="el" href="classtsip__stack.html#a987590d3e87ad0373356f1f966e2fab9">on_event_stack</a> callback function </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">i_timeout</td><td>Optional parameter used to defined maximum time in milliseconds to take to stop the stack. Default value: 2000 millis </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>0 if succeed and non-zero value otherwise </dd></dl>

</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="aae58d97571234f488efab116a83db829"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classtsip__stack.html#aae58d97571234f488efab116a83db829">tsip_stack::on_event_dialog</a><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Callback function called to report dialog events. This event is common to all sessions (INVITE, REGISTER, PUBLISH, INFO...) and used to report connection states (CONNECTED, CONNECTING, TERMINATING, TERMINATED....) and errors.</p>
<div class="fragment"><pre class="fragment">o_stack.on_event_dialog = <span class="keyword">function</span> (evt: tsip_event) {
    console.debug(<span class="stringliteral">&quot;phrase=%s&quot;</span>, evt.s_phrase);
    console.debug(<span class="stringliteral">&quot;sesssion id=%d&quot;</span>, evt.get_session().get_id());
    <span class="keywordflow">switch</span> (evt.i_code) {
        <span class="keywordflow">case</span> tsip_event_code_e.DIALOG_TRANSPORT_ERROR:
        <span class="keywordflow">case</span> tsip_event_code_e.DIALOG_GLOBAL_ERROR:
        <span class="keywordflow">case</span> tsip_event_code_e.DIALOG_MESSAGE_ERROR:
        <span class="keywordflow">case</span> tsip_event_code_e.DIALOG_WEBRTC_ERROR:

        <span class="keywordflow">case</span> tsip_event_code_e.DIALOG_REQUEST_INCOMING:
        <span class="keywordflow">case</span> tsip_event_code_e.DIALOG_REQUEST_OUTGOING:
        <span class="keywordflow">case</span> tsip_event_code_e.DIALOG_REQUEST_CANCELLED:
        <span class="keywordflow">case</span> tsip_event_code_e.DIALOG_REQUEST_SENT:
        <span class="keywordflow">case</span> tsip_event_code_e.DIALOG_MEDIA_ADDED:
        <span class="keywordflow">case</span> tsip_event_code_e.DIALOG_MEDIA_REMOVED:

        <span class="keywordflow">case</span> tsip_event_code_e.DIALOG_CONNECTING:
        <span class="keywordflow">case</span> tsip_event_code_e.DIALOG_CONNECTED:

        <span class="keywordflow">case</span> tsip_event_code_e.DIALOG_TERMINATING:
        <span class="keywordflow">case</span> tsip_event_code_e.DIALOG_TERMINATED:
        
        <span class="keywordflow">default</span>: <span class="keywordflow">break</span>;
    }
};
</pre></div> 
</div>
</div>
<a class="anchor" id="a9b0aa5e2c48c1aaf3d44dbb7000f2ef8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classtsip__stack.html#a9b0aa5e2c48c1aaf3d44dbb7000f2ef8">tsip_stack::on_event_invite</a><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Callback function used to report audio/video call (SIP INVITE) session events. Note that this callback won't report connection state. To get connection state, you should use <a class="el" href="classtsip__stack.html#aae58d97571234f488efab116a83db829">on_event_dialog</a> event.</p>
<div class="fragment"><pre class="fragment">o_stack.on_event_invite = <span class="keyword">function</span> (evt: tsip_event_invite) {
    console.debug(<span class="stringliteral">&quot;phrase=%s&quot;</span>, evt.s_phrase);
    console.debug(<span class="stringliteral">&quot;sesssion id=%d&quot;</span>, evt.get_session().get_id());
    <span class="keywordflow">switch</span> (evt.e_invite_type) {
        <span class="keywordflow">case</span> tsip_event_invite_type_e.I_NEW_CALL:
        
            <span class="keywordflow">case</span> tsip_event_invite_type_e.I_REQUEST:
            <span class="keywordflow">case</span> tsip_event_invite_type_e.I_AO_REQUEST:
        
        <span class="keywordflow">case</span> tsip_event_invite_type_e.O_ECT_TRYING:
        <span class="keywordflow">case</span> tsip_event_invite_type_e.O_ECT_ACCEPTED:
        <span class="keywordflow">case</span> tsip_event_invite_type_e.O_ECT_COMPLETED:
        <span class="keywordflow">case</span> tsip_event_invite_type_e.O_ECT_FAILED:
        <span class="keywordflow">case</span> tsip_event_invite_type_e.O_ECT_NOTIFY:
        <span class="keywordflow">case</span> tsip_event_invite_type_e.I_ECT_REQUESTED:
        <span class="keywordflow">case</span> tsip_event_invite_type_e.I_ECT_NEW_CALL:
        <span class="keywordflow">case</span> tsip_event_invite_type_e.I_ECT_COMPLETED:
        <span class="keywordflow">case</span> tsip_event_invite_type_e.I_ECT_FAILED:
        <span class="keywordflow">case</span> tsip_event_invite_type_e.I_ECT_NOTIFY:

            <span class="keywordflow">case</span> tsip_event_invite_type_e.M_EARLY_MEDIA:
            <span class="keywordflow">case</span> tsip_event_invite_type_e.M_UPDATING:
            <span class="keywordflow">case</span> tsip_event_invite_type_e.M_UPDATED:
            <span class="keywordflow">case</span> tsip_event_invite_type_e.M_STREAM_CONNECTING:
            <span class="keywordflow">case</span> tsip_event_invite_type_e.M_STREAM_CONNECTED:
        <span class="keywordflow">case</span> tsip_event_invite_type_e.M_STREAM_VIDEO_LOCAL_ADDED:
        <span class="keywordflow">case</span> tsip_event_invite_type_e.M_STREAM_VIDEO_LOCAL_REMOVED:
        <span class="keywordflow">case</span> tsip_event_invite_type_e.M_STREAM_VIDEO_REMOTE_ADDED:
        <span class="keywordflow">case</span> tsip_event_invite_type_e.M_STREAM_VIDEO_REMOTE_REMOVED:
        
            <span class="keywordflow">case</span> tsip_event_invite_type_e.M_LOCAL_HOLD_OK:
            <span class="keywordflow">case</span> tsip_event_invite_type_e.M_LOCAL_HOLD_NOK:
            <span class="keywordflow">case</span> tsip_event_invite_type_e.M_LOCAL_RESUME_OK:
            <span class="keywordflow">case</span> tsip_event_invite_type_e.M_LOCAL_RESUME_NOK:
            <span class="keywordflow">case</span> tsip_event_invite_type_e.M_REMOTE_HOLD:
            <span class="keywordflow">case</span> tsip_event_invite_type_e.M_REMOTE_RESUME:

        <span class="keywordflow">default</span>: <span class="keywordflow">break</span>;
    }
};
</pre></div> 
</div>
</div>
<a class="anchor" id="a157d58b5ad23f6ebcdda46f0d99088ae"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classtsip__stack.html#a157d58b5ad23f6ebcdda46f0d99088ae">tsip_stack::on_event_message</a><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Callback function used to report messaging (SIP MESSAGE) session events.</p>
<div class="fragment"><pre class="fragment">o_stack.on_event_message = <span class="keyword">function</span> (evt: tsip_event_message) {
    console.debug(<span class="stringliteral">&quot;phrase=%s&quot;</span>, evt.s_phrase);
    console.debug(<span class="stringliteral">&quot;sesssion id=%d&quot;</span>, evt.get_session().get_id());
    <span class="keywordflow">switch</span> (evt.e_message_type) {
        <span class="keywordflow">case</span> tsip_event_message_type_e.I_MESSAGE:
        <span class="keywordflow">case</span> tsip_event_message_type_e.AO_MESSAGE:
        <span class="keywordflow">default</span>: <span class="keywordflow">break</span>;
    }
};
</pre></div> 
</div>
</div>
<a class="anchor" id="a987590d3e87ad0373356f1f966e2fab9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classtsip__stack.html#a987590d3e87ad0373356f1f966e2fab9">tsip_stack::on_event_stack</a><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Callback function called to report Stack related events.</p>
<div class="fragment"><pre class="fragment">o_stack.on_event_stack = <span class="keyword">function</span> (evt: tsip_event) {
console.debug(evt.s_phrase);
    <span class="keywordflow">switch</span> (evt.i_code) {
        <span class="keywordflow">case</span> tsip_event_code_e.STACK_STARTED:
        <span class="keywordflow">case</span> tsip_event_code_e.STACK_STOPPING:
        <span class="keywordflow">case</span> tsip_event_code_e.STACK_STOPPED:
        <span class="keywordflow">case</span> tsip_event_code_e.STACK_STARTING:
        <span class="keywordflow">case</span> tsip_event_code_e.STACK_FAILED_TO_START:
        <span class="keywordflow">case</span> tsip_event_code_e.STACK_FAILED_TO_STOP:
        <span class="keywordflow">default</span>: <span class="keywordflow">break</span>;
    }
};
</pre></div> 
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>src/tinySIP/src/tsip_stack.cxx</li>
</ul>
</div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated on Wed May 16 2012 23:47:02 for sipML5 by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.0
</small></address>

</body>
</html>
